package server;




import java.io.Serializable;

import clientData.ForumDataInt;

import clientData.PostDataInt;

import clientData.TopicDataInt;


//enum Type{
//	FRIEND,MY_TOPICS,CURR_TOPIC
//}
/*
 * A friend notification is type = 0.
 * A Topic created by me notification is type = 1;
 * A Curent topic notification is type = 2.
 */

public class NotificationMsg implements Serializable,Cloneable{

	private static final long serialVersionUID = 1L;
	private String user;
	private ForumDataInt forumData;
	private TopicDataInt topicData;
	private PostDataInt postData;
	private int type;
	
	public NotificationMsg(String userName,ForumDataInt forum,TopicDataInt topic,PostDataInt post){
		this.setForum(forum);
		this.setTopic(topic);
		this.setPost(post);
		this.setUserName(userName);
	}
	
	public ForumDataInt getForum() {
		return this.forumData;
	}
	
	public TopicDataInt getTopic()	{
		return this.topicData;
	}
	
	public PostDataInt getPost() {
		return this.postData;
	}
	
	public void setUserName(String userName) {
		this.user = userName;
	}
	public void setForum(ForumDataInt forum) {
		this.forumData = forum;
	}
	
	public void setTopic(TopicDataInt topic) {
		this.topicData = topic;
	}
	
	public void setPost(PostDataInt post) {
		this.postData = post;
	}
	
	public String getUserName() {
		return this.user;
	}
	
	public void setType(int type) {
		this.type = type;
	}

	public int getType() {
		return type;
	}

    @Override
	public NotificationMsg clone() {
            NotificationMsg msg = new NotificationMsg(this.user,this.forumData,this.topicData,this.postData);
            msg.setType(this.type);
		return msg;
	}

    @Override
        public String toString(){
            return "Post: '" + getPost().getTitle() + "'. at topic: '" + getTopic().getTitle() +
                    "' at forum: '" + getForum().getName() + "'. set by user '"+ getUserName() + "'.";
        }

}
